// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// No Node.js APIs are available in this process because
// `nodeIntegration` is turned off. Use `preload.js` to
// selectively enable features needed in the rendering
// process.

const { ipcRenderer } = require("electron");
const $ = require("jquery");
$(() => {
  $(".btn").on("click", () => {
    ipcRenderer.send("chooseDir");
  });
  $(".btnClose").on("click", () => {
    ipcRenderer.send("closeDir");
  });

  ipcRenderer.on("onQrcode", (event, qrcode) => {
    console.log("qrcode:", qrcode);
    $(".qrcode").attr("src", qrcode);
  });
});
